<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>授权码</title>
</head>

<body>
    <h1>授权码：</h1>
    <span id="authorize_num"></span>

    <script src="./js/jquery.min.js"></script>
    <script>
        let number = Math.floor(Math.random() * 9999) + 1000;
        let spanE = document.querySelector("#authorize_num");
        spanE.innerText = number;
        $.ajax({
            // 发送请求
            type: 'post',
            url: '/register1',
            data: {
                authorize: number,
            },

            // 接收响应
            success: function(body) {},
            error: function() {
                alert("授权码传输错误！");
            }
        });
    </script>
</body>

</html>